<template>
<!-- <footer class="foot">
    <dl>
        <dt class="iconfont icon-eliaomo"></dt>
        <dd>外卖</dd>
    </dl>
    <dl>
        <dt class="iconfont icon-icon-yxj-empty-discover"></dt>
        <dd>发现</dd>
    </dl>
    <dl>
        <dt class="iconfont icon-dingdan"></dt>
        <dd>订单</dd>
    </dl>
    <dl>
        <dt class="iconfont icon-home"></dt>
        <dd>我的</dd>
    </dl> -->
<!-- </footer> -->
 <footer class="footer">
    <router-link v-for="(v, i) in list" :key="i" @click.native="switchFoot(v)" tag="figure" :to="v.path">
      <p :class="v.as">
      <figcaption>{{v.name}}</figcaption>
    </router-link>
  </footer>
</template>
<script>
export default {
  data() {
    return {
      list: [
        {
          as: "iconfont icon-eliaomo",
          name: "外卖",
          path: "/"
        },
        {
          as: "iconfont icon-icon-yxj-empty-discover",
          name: "发现",
          path: "/kty"
        },
        {
          as: "iconfont icon-dingdan",
          name: "订单",
          path: "/dingdan"
        },
        {
          as: "iconfont icon-home",
          name: "我的",
          path: "/wode"
        }
      ]
    };
  },
  methods: {
    switchFoot(v) {
      this.$emit("navTitle", v.name);
    }
  },
  created() {
    this.$emit("navTitle", this.list[0].name);
  }
};
</script>
<style scoped lang="less">
.px2rem(@name, @px) {
  @{name}: @px / 75 * 1rem;
}
//    .foot{
//        width: 100%;
//        .px2rem(height,120);
//        display: flex;
//        position: fixed;
//        bottom: 0;
//        left: 0;
//        background: #fff;
//        border-top: 2px solid #eee;
//        dl{
//            width: 25%;
//            .px2rem(height,100);
//            text-align: center;
//            color: #333333;
//            .px2rem(margin-top,20);
//            dt{
//                .px2rem(font-size,44);
//            }
//            dd{
//                .px2rem(font-size,34);
//                 .px2rem(margin-top,10);
//                 box-sizing: border-box;
//            }
//        }
//        dl:first-child{
//            color: #3366FF;
//        }
//    }
.footer {
  font-family: "楷体";
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  .px2rem(height,100);
  display: flex;
  background: white;
  figure {
    &.router-link-exact-active {
      background-color: #fff;
    }
    flex: 1;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    p {
      .px2rem(font-size,40);
    }
    figcaption {
      .px2rem(font-size,25);
      .px2rem(margin-top,10);
      box-sizing: border-box;
    }
  }
  figure:first-child {
    color: #3366ff;
  }
}
</style>
